package de.uni.muenster.idw2.data;

import android.os.Parcel;
import android.os.Parcelable;

public class Node implements Parcelable{

	
	private Position position;
	private double h;
	
	public Node(Parcel source){
		position = source.readParcelable(Position.class.getClassLoader());
		h = source.readDouble();
	}
	
	public Node(Position position, double h) {
		super();
		this.position = position;
		this.h = h;
	}

	public Node(double x, double y, int floor, double h) {
		super();
		this.position = new Position(x, y, floor);
		this.h = h;
	}
	
	public Position getPosition() {
		return position;
	}
	public void setPosition(Position position) {
		this.position = position;
	}
	public double getH() {
		return h;
	}
	public void setH(double h) {
		this.h = h;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeParcelable(position, flags);
		dest.writeDouble(h);
	}
	
	
	public static final Parcelable.Creator CREATOR = new Creator() {

		@Override
		public Node createFromParcel(Parcel source) {
			return new Node(source);
		}

		@Override
		public Node[] newArray(int size) {
			return new Node[size];
		}
	};
	
}
